﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Com.CMS263.BLL;
using Com.CMS263.PO;
using Com.CMS263.Util;

namespace Com.CMS263.Web.manage.ManageCommunity
{
    public partial class action : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            string op = Request["op"];
            if (op == "getArea")
            {
                int id = Convert.ToInt32(Request["rid"]);
                RegionBLL rbll = new RegionBLL();
                var list = rbll.GetListPaging(id, -1);
                string str = "";
                foreach (var item in list)
                {
                    str += item.Name + "|";
                }
                if (str.Length > 1)
                {
                    str = str.Substring(0, str.Length - 1);
                }
                Response.Write(str);
            }
            else if (op == "del")
            {
                int id = int.Parse(Request["id"]);
                CommunityBLL cbll = new CommunityBLL();
                if (cbll.Delete("Community", id))
                {

                    Response.Write("ok");
                }
                else
                {
                    Response.Write("fail");
                }
            }
        }
    }
}
